# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models

class Migration(SchemaMigration):

    def forwards(self, orm):
        
        # Adding model 'SubjectSessionFile'
        db.create_table('experiment_subjectsessionfile', (
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('subject_session', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['experiment.SubjectSession'])),
            ('details', self.gf('django.db.models.fields.CharField')(max_length=200, blank=True)),
            ('filename', self.gf('django.db.models.fields.files.FileField')(max_length=100)),
            ('digest', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)),
        ))
        db.send_create_signal('experiment', ['SubjectSessionFile'])

        # Adding field 'Subject.path'
        db.add_column('experiment_subject', 'path', self.gf('django.db.models.fields.FilePathField')(default='', path='/Users/zarrar/Dropbox/sites/accession/filedb/', max_length=200, blank=True), keep_default=False)

        # Adding field 'Subject.path_type'
        db.add_column('experiment_subject', 'path_type', self.gf('django.db.models.fields.PositiveSmallIntegerField')(default=1, blank=True), keep_default=False)

        # Adding field 'SubjectSession.path'
        db.add_column('experiment_subjectsession', 'path', self.gf('django.db.models.fields.FilePathField')(default='', path='/Users/zarrar/Dropbox/sites/accession/filedb/', max_length=200, blank=True), keep_default=False)

        # Adding field 'SubjectSession.path_type'
        db.add_column('experiment_subjectsession', 'path_type', self.gf('django.db.models.fields.PositiveSmallIntegerField')(default=1, blank=True), keep_default=False)


    def backwards(self, orm):
        
        # Deleting model 'SubjectSessionFile'
        db.delete_table('experiment_subjectsessionfile')

        # Deleting field 'Subject.path'
        db.delete_column('experiment_subject', 'path')

        # Deleting field 'Subject.path_type'
        db.delete_column('experiment_subject', 'path_type')

        # Deleting field 'SubjectSession.path'
        db.delete_column('experiment_subjectsession', 'path')

        # Deleting field 'SubjectSession.path_type'
        db.delete_column('experiment_subjectsession', 'path_type')


    models = {
        'auth.group': {
            'Meta': {'object_name': 'Group'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
        },
        'auth.permission': {
            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
        },
        'auth.user': {
            'Meta': {'object_name': 'User'},
            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
        },
        'contenttypes.contenttype': {
            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
        },
        'experiment.compensationsource': {
            'Meta': {'object_name': 'CompensationSource'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '150'})
        },
        'experiment.compensationtype': {
            'Meta': {'object_name': 'CompensationType'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'})
        },
        'experiment.contact': {
            'Meta': {'object_name': 'Contact'},
            'active_date': ('django.db.models.fields.DateField', [], {}),
            'address_1': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
            'address_2': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
            'allow_contact': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'city': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
            'emails': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['experiment.Email']", 'symmetrical': 'False'}),
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'notes': ('django.db.models.fields.TextField', [], {}),
            'phones': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['experiment.Phone']", 'symmetrical': 'False'}),
            'state': ('django.contrib.localflavor.us.models.USStateField', [], {'max_length': '2'}),
            'subject': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['experiment.Subject']", 'unique': 'True'}),
            'zip_code': ('django.db.models.fields.CharField', [], {'max_length': '5'})
        },
        'experiment.email': {
            'Meta': {'object_name': 'Email'},
            'email': ('django.db.models.fields.EmailField', [], {'unique': 'True', 'max_length': '150'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
        },
        'experiment.experiment': {
            'Meta': {'object_name': 'Experiment'},
            'details': ('django.db.models.fields.TextField', [], {}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'}),
            'nih': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'path': ('django.db.models.fields.FilePathField', [], {'path': "'/Users/zarrar/Dropbox/sites/accession/filedb/'", 'max_length': '200', 'blank': 'True'}),
            'path_type': ('django.db.models.fields.PositiveSmallIntegerField', [], {'blank': 'True'}),
            'project_leader': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['lab.Researcher']"}),
            'protocol': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['protocol.Protocol']"}),
            'sensitive': ('django.db.models.fields.TextField', [], {'blank': 'True'})
        },
        'experiment.location': {
            'Meta': {'object_name': 'Location'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '150'})
        },
        'experiment.phone': {
            'Meta': {'object_name': 'Phone'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'number': ('django.contrib.localflavor.us.models.PhoneNumberField', [], {'unique': 'True', 'max_length': '20'})
        },
        'experiment.race': {
            'Meta': {'object_name': 'Race'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'})
        },
        'experiment.subject': {
            'Meta': {'object_name': 'Subject'},
            'codes': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['experiment.SubjectCode']", 'symmetrical': 'False'}),
            'ethnicity': ('django.db.models.fields.CharField', [], {'max_length': '1'}),
            'experiment': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['experiment.Experiment']"}),
            'gender': ('django.db.models.fields.CharField', [], {'max_length': '1'}),
            'handedness': ('django.db.models.fields.CharField', [], {'max_length': '1'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'notes': ('django.db.models.fields.TextField', [], {}),
            'other': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'other_rel_+'", 'to': "orm['experiment.Subject']"}),
            'path': ('django.db.models.fields.FilePathField', [], {'path': "'/Users/zarrar/Dropbox/sites/accession/filedb/'", 'max_length': '200', 'blank': 'True'}),
            'path_type': ('django.db.models.fields.PositiveSmallIntegerField', [], {'blank': 'True'}),
            'race': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['experiment.Race']", 'symmetrical': 'False'})
        },
        'experiment.subjectcode': {
            'Meta': {'object_name': 'SubjectCode'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'})
        },
        'experiment.subjectsession': {
            'Meta': {'unique_together': "(('subject', 'session'),)", 'object_name': 'SubjectSession'},
            'adverse_event': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'age': ('django.db.models.fields.PositiveIntegerField', [], {}),
            'compensation': ('django.db.models.fields.DecimalField', [], {'max_digits': '10', 'decimal_places': '2'}),
            'compensation_source': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['experiment.CompensationSource']"}),
            'compensation_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['experiment.CompensationType']"}),
            'completed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'consented': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'consenter': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'session_consenter'", 'to': "orm['lab.Researcher']"}),
            'copy_consent': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'date_tested': ('django.db.models.fields.DateField', [], {}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'location': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['experiment.Location']"}),
            'notes': ('django.db.models.fields.TextField', [], {}),
            'path': ('django.db.models.fields.FilePathField', [], {'path': "'/Users/zarrar/Dropbox/sites/accession/filedb/'", 'max_length': '200', 'blank': 'True'}),
            'path_type': ('django.db.models.fields.PositiveSmallIntegerField', [], {'blank': 'True'}),
            'researchers': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['lab.Researcher']", 'symmetrical': 'False'}),
            'session': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}),
            'subject': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['experiment.Subject']"}),
            'time_tested': ('django.db.models.fields.TimeField', [], {})
        },
        'experiment.subjectsessionfile': {
            'Meta': {'object_name': 'SubjectSessionFile'},
            'details': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),
            'digest': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
            'filename': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'subject_session': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['experiment.SubjectSession']"})
        },
        'lab.lab': {
            'Meta': {'object_name': 'Lab'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}),
            'path': ('django.db.models.fields.FilePathField', [], {'path': "'/Users/zarrar/Dropbox/sites/accession/filedb/'", 'max_length': '200', 'blank': 'True'}),
            'path_type': ('django.db.models.fields.PositiveSmallIntegerField', [], {'blank': 'True'})
        },
        'lab.researcher': {
            'Meta': {'unique_together': "(('user', 'lab'),)", 'object_name': 'Researcher'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'lab': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['lab.Lab']"}),
            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True'})
        },
        'protocol.committee': {
            'Meta': {'object_name': 'Committee'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20'})
        },
        'protocol.institution': {
            'Meta': {'object_name': 'Institution'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'})
        },
        'protocol.protocol': {
            'Meta': {'object_name': 'Protocol'},
            'committee': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['protocol.Committee']"}),
            'date_added': ('django.db.models.fields.DateField', [], {'default': 'datetime.datetime.now', 'auto_now_add': 'True', 'blank': 'True'}),
            'date_updated': ('django.db.models.fields.DateField', [], {'default': 'datetime.datetime.now', 'auto_now': 'True', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'institution': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['protocol.Institution']"}),
            'investigator': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'investigator'", 'to': "orm['lab.Researcher']"}),
            'lab': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['lab.Lab']"}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),
            'path': ('django.db.models.fields.FilePathField', [], {'path': "'/Users/zarrar/Dropbox/sites/accession/filedb/'", 'max_length': '200', 'blank': 'True'}),
            'path_type': ('django.db.models.fields.PositiveSmallIntegerField', [], {'blank': 'True'}),
            'protocol_status': ('django.db.models.fields.PositiveSmallIntegerField', [], {}),
            'reference_code': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'researchers': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['lab.Researcher']", 'symmetrical': 'False'})
        }
    }

    complete_apps = ['experiment']
